#! /bin/sh
# shell for uniformly sampling velocity from a layered model
set -v

nz=501 dz=5 fz=.0  labelz="Depth (m)"
nx=1000 dx=20 fx=0.0  labelx="Distance (m)"
ninf=6 npmax=201 
nt=1001
dt=0.004

nxm=1001 fxm=0 dxm=20
nxo=1 fxo=0 dxo=10
nx=1001 fx=0 dx=20
nz=51 dz=50 nxb=80 nxd=5
fpeak=20 ls=1 verbose=1

makevel nz=1001 nx=51 v000=1500 > data.v

susynvxz <data.v nt=$nt ft=$ft dt=$dt tmin=$tmin \
                nxm=$nxm fxm=$fxm dxm=$dxm \
                nxo=$nxo fxo=$fxo dxo=$dxo \
                nx=$nx fx=$fx dx=$dx \
                nz=$nz dz=$dz nxb=$nxb nxd=$nxd \
                fpeak=$fpeak ls=$ls verbose=$verbose \
 ref="1:0,500;10000,500;20000,500" \
 ref="1:0,800;10000,800;20000,800"\
 ref="1:0,900;3000,900;3500,900;6000,1200;9000,1200;12000,900;20000,900"\
 ref="1:0,1100;3000,1100;3500,1100;6000,1400;9500,1400;12000,1100;20000,1100"\
 ref="1:0,1800;2000,1800;3500,1800;14000,1600;20000,1600"\
 ref="1:0,2200;2000,2200;3500,2200;10000,2000;20000,2000" >vxz.su


# Migrate the synthetics 
sukdmig2d infile=vxz.su par=kdmig.par > kd.su
# Generate Synthetics
sustrip < kd.su > kd.stripped
sukdsyn2d infile=kd.stripped par=kdsyn.par > kdsyn.su

